//
//  UIColorExtension.swift
//  PropertyCommunity
//
//  Created by benwang on 2021/6/24.
//

import UIKit

public extension UIImage {

  @available(iOS 10.0, *)
  static func image(with color: UIColor) -> UIImage {
    let renderer = UIGraphicsImageRenderer(size: CGSize(width: 1, height: 1))
    return renderer.image { (context) in
      color.setFill()
      context.fill(renderer.format.bounds)
    }
  }

}
